home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _usleep.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  1KB  |  58 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef PDC_usleep
  4.  
  5. #if defined(DOS) && defined(MSC)
  6. #include <time.h>
  7. #endif
  8.  
  9. #ifdef PDCDEBUG
  10. char *rcsid__usleep = "$Header: C:\CURSES\private\RCS\_usleep.c 2.1 1993/06/18 20:23:54 MH Rel MH $";
  11. #endif
  12.  
  13.  
  14.  
  15. /*man-start*********************************************************************
  16.  
  17.   PDC_usleep()    - waits for specified number of microseconds
  18.  
  19.   PDCurses Description:
  20.      This routine is intended to provide a mechanism to wait the
  21.      specified number of microseconds. This routine is provided for
  22.      users of the Microsoft compilers under DOS as the default
  23.      library does not provide a suitable function.
  24.      Under any other Operating System/Compiler option, this function
  25.      does nothing.
  26.  
  27.   Portability:
  28.      PDCurses    void PDC_usleep( clock_t );
  29.  
  30.   Acknowledgement
  31.      PDC_usleep() was written by John Steele  (jsteele@netcom.com)
  32.  
  33. **man-end**********************************************************************/
  34.  
  35. #if defined(DOS) && defined(MSC)
  36. void    PDC_usleep(clock_t wait)
  37. {
  38.     clock_t goal;
  39. #ifdef PDCDEBUG
  40.     if (trace_on) PDC_debug("PDC_usleep() - called\n");
  41. #endif
  42.  
  43.     goal = wait + clock();
  44.     while (goal > clock())
  45.     ;
  46.     return;
  47. }
  48. #else
  49. void    PDC_usleep(long wait)
  50. {
  51. #ifdef PDCDEBUG
  52.     if (trace_on) PDC_debug("PDC_usleep() - called\n");
  53. #endif
  54.  
  55.     return;
  56. }
  57. #endif
  58.